// Lean compiler output
// Module: Lean.Meta.Tactic.Grind.Proj
// Imports: public import Lean.Meta.Tactic.Grind.Types import Lean.Meta.Tactic.Grind.Internalize
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
lean_object* l_Lean_mkAppN(lean_object*, lean_object*);
static lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2;
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_sort___override(lean_object*);
lean_object* lean_mk_array(lean_object*, lean_object*);
lean_object* l_Lean_Meta_Grind_getRootENode___redArg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Expr_isAppOf(lean_object*, lean_object*);
lean_object* l_Lean_Expr_appArg_x21(lean_object*);
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Name_mkStr3(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_st_ref_take(lean_object*);
lean_object* l_Lean_Expr_getRevArg_x21(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Grind_propagateProjEq___closed__0;
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(lean_object*, lean_object*);
lean_object* l_Lean_Meta_Grind_isCongrRoot___redArg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Grind_propagateProjEq(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1;
static lean_object* l_Lean_Meta_Grind_propagateProjEq___closed__3;
double lean_float_of_nat(lean_object*);
lean_object* lean_st_ref_get(lean_object*);
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_checkTraceOption(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_ofSubarray___redArg(lean_object*);
lean_object* l_Lean_PersistentArray_push___redArg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg(lean_object*, lean_object*);
lean_object* l_Lean_Meta_Grind_getGeneration___redArg(lean_object*, lean_object*);
lean_object* l_Lean_Expr_appFn_x21(lean_object*);
lean_object* l_Lean_Meta_Grind_pushEqCore___redArg(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_Grind_updateLastTag(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static double l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0;
lean_object* l_Lean_MessageData_ofExpr(lean_object*);
uint8_t l___private_Lean_Meta_Tactic_Grind_ExprPtr_0__Lean_Meta_Grind_isSameExpr_unsafe__1(lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppNumArgs(lean_object*);
static lean_object* l_Lean_Meta_Grind_propagateProjEq___closed__2;
lean_object* l_Lean_Expr_app___override(lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Grind_propagateProjEq___closed__4;
lean_object* l_Lean_Meta_mkEqRefl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Grind_propagateProjEq___closed__1;
lean_object* l_Array_toSubarray___redArg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppFn(lean_object*);
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_st_ref_set(lean_object*, lean_object*);
lean_object* l_Lean_Meta_Grind_shareCommon___redArg(lean_object*, lean_object*);
lean_object* l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Grind_propagateProjEq___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2_spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2_spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* lean_get_projection_info(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_grind_internalize(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2_spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_7 = lean_st_ref_get(x_5);
x_8 = lean_ctor_get(x_7, 0);
lean_inc_ref(x_8);
lean_dec(x_7);
x_9 = lean_st_ref_get(x_3);
x_10 = lean_ctor_get(x_9, 0);
lean_inc_ref(x_10);
lean_dec(x_9);
x_11 = lean_ctor_get(x_2, 2);
x_12 = lean_ctor_get(x_4, 2);
lean_inc(x_12);
lean_inc_ref(x_11);
x_13 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_13, 0, x_8);
lean_ctor_set(x_13, 1, x_10);
lean_ctor_set(x_13, 2, x_11);
lean_ctor_set(x_13, 3, x_12);
x_14 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set(x_14, 0, x_13);
lean_ctor_set(x_14, 1, x_1);
x_15 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_15, 0, x_14);
return x_15;
}
}
static double _init_l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0() {
_start:
{
lean_object* x_1; double x_2; 
x_1 = lean_unsigned_to_nat(0u);
x_2 = lean_float_of_nat(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("", 0, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_unsigned_to_nat(0u);
x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_8; lean_object* x_9; uint8_t x_10; 
x_8 = lean_ctor_get(x_5, 5);
x_9 = l_Lean_addMessageContextFull___at___00Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2_spec__2(x_2, x_3, x_4, x_5, x_6);
x_10 = !lean_is_exclusive(x_9);
if (x_10 == 0)
{
lean_object* x_11; lean_object* x_12; uint8_t x_13; 
x_11 = lean_ctor_get(x_9, 0);
x_12 = lean_st_ref_take(x_6);
x_13 = !lean_is_exclusive(x_12);
if (x_13 == 0)
{
lean_object* x_14; uint8_t x_15; 
x_14 = lean_ctor_get(x_12, 4);
x_15 = !lean_is_exclusive(x_14);
if (x_15 == 0)
{
lean_object* x_16; double x_17; uint8_t x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; 
x_16 = lean_ctor_get(x_14, 0);
x_17 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0;
x_18 = 0;
x_19 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1;
x_20 = lean_alloc_ctor(0, 2, 17);
lean_ctor_set(x_20, 0, x_1);
lean_ctor_set(x_20, 1, x_19);
lean_ctor_set_float(x_20, sizeof(void*)*2, x_17);
lean_ctor_set_float(x_20, sizeof(void*)*2 + 8, x_17);
lean_ctor_set_uint8(x_20, sizeof(void*)*2 + 16, x_18);
x_21 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2;
x_22 = lean_alloc_ctor(9, 3, 0);
lean_ctor_set(x_22, 0, x_20);
lean_ctor_set(x_22, 1, x_11);
lean_ctor_set(x_22, 2, x_21);
lean_inc(x_8);
x_23 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_23, 0, x_8);
lean_ctor_set(x_23, 1, x_22);
x_24 = l_Lean_PersistentArray_push___redArg(x_16, x_23);
lean_ctor_set(x_14, 0, x_24);
x_25 = lean_st_ref_set(x_6, x_12);
x_26 = lean_box(0);
lean_ctor_set(x_9, 0, x_26);
return x_9;
}
else
{
uint64_t x_27; lean_object* x_28; double x_29; uint8_t x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; 
x_27 = lean_ctor_get_uint64(x_14, sizeof(void*)*1);
x_28 = lean_ctor_get(x_14, 0);
lean_inc(x_28);
lean_dec(x_14);
x_29 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0;
x_30 = 0;
x_31 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1;
x_32 = lean_alloc_ctor(0, 2, 17);
lean_ctor_set(x_32, 0, x_1);
lean_ctor_set(x_32, 1, x_31);
lean_ctor_set_float(x_32, sizeof(void*)*2, x_29);
lean_ctor_set_float(x_32, sizeof(void*)*2 + 8, x_29);
lean_ctor_set_uint8(x_32, sizeof(void*)*2 + 16, x_30);
x_33 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2;
x_34 = lean_alloc_ctor(9, 3, 0);
lean_ctor_set(x_34, 0, x_32);
lean_ctor_set(x_34, 1, x_11);
lean_ctor_set(x_34, 2, x_33);
lean_inc(x_8);
x_35 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_35, 0, x_8);
lean_ctor_set(x_35, 1, x_34);
x_36 = l_Lean_PersistentArray_push___redArg(x_28, x_35);
x_37 = lean_alloc_ctor(0, 1, 8);
lean_ctor_set(x_37, 0, x_36);
lean_ctor_set_uint64(x_37, sizeof(void*)*1, x_27);
lean_ctor_set(x_12, 4, x_37);
x_38 = lean_st_ref_set(x_6, x_12);
x_39 = lean_box(0);
lean_ctor_set(x_9, 0, x_39);
return x_9;
}
}
else
{
lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; uint64_t x_49; lean_object* x_50; lean_object* x_51; double x_52; uint8_t x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; 
x_40 = lean_ctor_get(x_12, 4);
x_41 = lean_ctor_get(x_12, 0);
x_42 = lean_ctor_get(x_12, 1);
x_43 = lean_ctor_get(x_12, 2);
x_44 = lean_ctor_get(x_12, 3);
x_45 = lean_ctor_get(x_12, 5);
x_46 = lean_ctor_get(x_12, 6);
x_47 = lean_ctor_get(x_12, 7);
x_48 = lean_ctor_get(x_12, 8);
lean_inc(x_48);
lean_inc(x_47);
lean_inc(x_46);
lean_inc(x_45);
lean_inc(x_40);
lean_inc(x_44);
lean_inc(x_43);
lean_inc(x_42);
lean_inc(x_41);
lean_dec(x_12);
x_49 = lean_ctor_get_uint64(x_40, sizeof(void*)*1);
x_50 = lean_ctor_get(x_40, 0);
lean_inc_ref(x_50);
if (lean_is_exclusive(x_40)) {
 lean_ctor_release(x_40, 0);
 x_51 = x_40;
} else {
 lean_dec_ref(x_40);
 x_51 = lean_box(0);
}
x_52 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0;
x_53 = 0;
x_54 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1;
x_55 = lean_alloc_ctor(0, 2, 17);
lean_ctor_set(x_55, 0, x_1);
lean_ctor_set(x_55, 1, x_54);
lean_ctor_set_float(x_55, sizeof(void*)*2, x_52);
lean_ctor_set_float(x_55, sizeof(void*)*2 + 8, x_52);
lean_ctor_set_uint8(x_55, sizeof(void*)*2 + 16, x_53);
x_56 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2;
x_57 = lean_alloc_ctor(9, 3, 0);
lean_ctor_set(x_57, 0, x_55);
lean_ctor_set(x_57, 1, x_11);
lean_ctor_set(x_57, 2, x_56);
lean_inc(x_8);
x_58 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_58, 0, x_8);
lean_ctor_set(x_58, 1, x_57);
x_59 = l_Lean_PersistentArray_push___redArg(x_50, x_58);
if (lean_is_scalar(x_51)) {
 x_60 = lean_alloc_ctor(0, 1, 8);
} else {
 x_60 = x_51;
}
lean_ctor_set(x_60, 0, x_59);
lean_ctor_set_uint64(x_60, sizeof(void*)*1, x_49);
x_61 = lean_alloc_ctor(0, 9, 0);
lean_ctor_set(x_61, 0, x_41);
lean_ctor_set(x_61, 1, x_42);
lean_ctor_set(x_61, 2, x_43);
lean_ctor_set(x_61, 3, x_44);
lean_ctor_set(x_61, 4, x_60);
lean_ctor_set(x_61, 5, x_45);
lean_ctor_set(x_61, 6, x_46);
lean_ctor_set(x_61, 7, x_47);
lean_ctor_set(x_61, 8, x_48);
x_62 = lean_st_ref_set(x_6, x_61);
x_63 = lean_box(0);
lean_ctor_set(x_9, 0, x_63);
return x_9;
}
}
else
{
lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; uint64_t x_76; lean_object* x_77; lean_object* x_78; double x_79; uint8_t x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; 
x_64 = lean_ctor_get(x_9, 0);
lean_inc(x_64);
lean_dec(x_9);
x_65 = lean_st_ref_take(x_6);
x_66 = lean_ctor_get(x_65, 4);
lean_inc_ref(x_66);
x_67 = lean_ctor_get(x_65, 0);
lean_inc_ref(x_67);
x_68 = lean_ctor_get(x_65, 1);
lean_inc(x_68);
x_69 = lean_ctor_get(x_65, 2);
lean_inc_ref(x_69);
x_70 = lean_ctor_get(x_65, 3);
lean_inc_ref(x_70);
x_71 = lean_ctor_get(x_65, 5);
lean_inc_ref(x_71);
x_72 = lean_ctor_get(x_65, 6);
lean_inc_ref(x_72);
x_73 = lean_ctor_get(x_65, 7);
lean_inc_ref(x_73);
x_74 = lean_ctor_get(x_65, 8);
lean_inc_ref(x_74);
if (lean_is_exclusive(x_65)) {
 lean_ctor_release(x_65, 0);
 lean_ctor_release(x_65, 1);
 lean_ctor_release(x_65, 2);
 lean_ctor_release(x_65, 3);
 lean_ctor_release(x_65, 4);
 lean_ctor_release(x_65, 5);
 lean_ctor_release(x_65, 6);
 lean_ctor_release(x_65, 7);
 lean_ctor_release(x_65, 8);
 x_75 = x_65;
} else {
 lean_dec_ref(x_65);
 x_75 = lean_box(0);
}
x_76 = lean_ctor_get_uint64(x_66, sizeof(void*)*1);
x_77 = lean_ctor_get(x_66, 0);
lean_inc_ref(x_77);
if (lean_is_exclusive(x_66)) {
 lean_ctor_release(x_66, 0);
 x_78 = x_66;
} else {
 lean_dec_ref(x_66);
 x_78 = lean_box(0);
}
x_79 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0;
x_80 = 0;
x_81 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1;
x_82 = lean_alloc_ctor(0, 2, 17);
lean_ctor_set(x_82, 0, x_1);
lean_ctor_set(x_82, 1, x_81);
lean_ctor_set_float(x_82, sizeof(void*)*2, x_79);
lean_ctor_set_float(x_82, sizeof(void*)*2 + 8, x_79);
lean_ctor_set_uint8(x_82, sizeof(void*)*2 + 16, x_80);
x_83 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2;
x_84 = lean_alloc_ctor(9, 3, 0);
lean_ctor_set(x_84, 0, x_82);
lean_ctor_set(x_84, 1, x_64);
lean_ctor_set(x_84, 2, x_83);
lean_inc(x_8);
x_85 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_85, 0, x_8);
lean_ctor_set(x_85, 1, x_84);
x_86 = l_Lean_PersistentArray_push___redArg(x_77, x_85);
if (lean_is_scalar(x_78)) {
 x_87 = lean_alloc_ctor(0, 1, 8);
} else {
 x_87 = x_78;
}
lean_ctor_set(x_87, 0, x_86);
lean_ctor_set_uint64(x_87, sizeof(void*)*1, x_76);
if (lean_is_scalar(x_75)) {
 x_88 = lean_alloc_ctor(0, 9, 0);
} else {
 x_88 = x_75;
}
lean_ctor_set(x_88, 0, x_67);
lean_ctor_set(x_88, 1, x_68);
lean_ctor_set(x_88, 2, x_69);
lean_ctor_set(x_88, 3, x_70);
lean_ctor_set(x_88, 4, x_87);
lean_ctor_set(x_88, 5, x_71);
lean_ctor_set(x_88, 6, x_72);
lean_ctor_set(x_88, 7, x_73);
lean_ctor_set(x_88, 8, x_74);
x_89 = lean_st_ref_set(x_6, x_88);
x_90 = lean_box(0);
x_91 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_91, 0, x_90);
return x_91;
}
}
}
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
_start:
{
lean_object* x_12; 
x_12 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(x_1, x_2, x_7, x_8, x_9, x_10);
return x_12;
}
}
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; 
x_4 = lean_st_ref_get(x_2);
x_5 = lean_ctor_get(x_4, 0);
lean_inc_ref(x_5);
lean_dec(x_4);
x_6 = lean_get_projection_info(x_5, x_1);
x_7 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_7, 0, x_6);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
_start:
{
lean_object* x_11; 
x_11 = l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg(x_1, x_9);
return x_11;
}
}
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_4; lean_object* x_5; uint8_t x_6; lean_object* x_7; lean_object* x_8; 
x_4 = lean_ctor_get(x_2, 2);
x_5 = lean_ctor_get(x_2, 13);
x_6 = l_Lean_checkTraceOption(x_5, x_4, x_1);
x_7 = lean_box(x_6);
x_8 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_8, 0, x_7);
return x_8;
}
}
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
_start:
{
lean_object* x_11; 
x_11 = l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(x_1, x_8);
return x_11;
}
}
static lean_object* _init_l_Lean_Meta_Grind_propagateProjEq___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("grind", 5, 5);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Grind_propagateProjEq___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("debug", 5, 5);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Grind_propagateProjEq___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("proj", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Grind_propagateProjEq___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
x_1 = l_Lean_Meta_Grind_propagateProjEq___closed__2;
x_2 = l_Lean_Meta_Grind_propagateProjEq___closed__1;
x_3 = l_Lean_Meta_Grind_propagateProjEq___closed__0;
x_4 = l_Lean_Name_mkStr3(x_3, x_2, x_1);
return x_4;
}
}
static lean_object* _init_l_Lean_Meta_Grind_propagateProjEq___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_box(0);
x_2 = l_Lean_Expr_sort___override(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Grind_propagateProjEq(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
_start:
{
lean_object* x_11; 
x_11 = l_Lean_Expr_getAppFn(x_1);
if (lean_obj_tag(x_11) == 4)
{
lean_object* x_12; lean_object* x_13; uint8_t x_14; 
x_12 = lean_ctor_get(x_11, 0);
lean_inc(x_12);
x_13 = l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg(x_12, x_9);
x_14 = !lean_is_exclusive(x_13);
if (x_14 == 0)
{
lean_object* x_15; 
x_15 = lean_ctor_get(x_13, 0);
if (lean_obj_tag(x_15) == 1)
{
lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_23; 
x_16 = lean_ctor_get(x_15, 0);
lean_inc(x_16);
lean_dec_ref(x_15);
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
x_18 = lean_ctor_get(x_16, 1);
lean_inc(x_18);
x_19 = lean_ctor_get(x_16, 2);
lean_inc(x_19);
lean_dec(x_16);
x_20 = lean_unsigned_to_nat(1u);
x_21 = lean_nat_add(x_18, x_20);
x_22 = l_Lean_Expr_getAppNumArgs(x_1);
x_23 = lean_nat_dec_eq(x_21, x_22);
lean_dec(x_22);
lean_dec(x_21);
if (x_23 == 0)
{
lean_object* x_24; 
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_17);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_24 = lean_box(0);
lean_ctor_set(x_13, 0, x_24);
return x_13;
}
else
{
lean_object* x_25; 
lean_free_object(x_13);
lean_inc_ref(x_1);
x_25 = l_Lean_Meta_Grind_isCongrRoot___redArg(x_1, x_2, x_6, x_7, x_8, x_9);
if (lean_obj_tag(x_25) == 0)
{
uint8_t x_26; 
x_26 = !lean_is_exclusive(x_25);
if (x_26 == 0)
{
lean_object* x_27; uint8_t x_28; 
x_27 = lean_ctor_get(x_25, 0);
x_28 = lean_unbox(x_27);
lean_dec(x_27);
if (x_28 == 0)
{
lean_object* x_29; 
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_17);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_29 = lean_box(0);
lean_ctor_set(x_25, 0, x_29);
return x_25;
}
else
{
lean_object* x_30; lean_object* x_31; 
x_30 = l_Lean_Expr_appArg_x21(x_1);
lean_inc_ref(x_30);
x_31 = l_Lean_Meta_Grind_getRootENode___redArg(x_30, x_2, x_6, x_7, x_8, x_9);
if (lean_obj_tag(x_31) == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; uint8_t x_96; 
x_32 = lean_ctor_get(x_31, 0);
lean_inc(x_32);
if (lean_is_exclusive(x_31)) {
 lean_ctor_release(x_31, 0);
 x_33 = x_31;
} else {
 lean_dec_ref(x_31);
 x_33 = lean_box(0);
}
x_34 = lean_ctor_get(x_32, 0);
lean_inc_ref(x_34);
x_35 = lean_ctor_get_uint8(x_32, sizeof(void*)*11 + 4);
lean_dec(x_32);
x_96 = l_Lean_Expr_isAppOf(x_34, x_17);
lean_dec(x_17);
if (x_96 == 0)
{
lean_object* x_97; 
lean_dec_ref(x_34);
lean_dec(x_33);
lean_dec_ref(x_30);
lean_dec(x_19);
lean_dec(x_18);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_97 = lean_box(0);
lean_ctor_set(x_25, 0, x_97);
return x_25;
}
else
{
uint8_t x_98; 
lean_free_object(x_25);
x_98 = l___private_Lean_Meta_Tactic_Grind_ExprPtr_0__Lean_Meta_Grind_isSameExpr_unsafe__1(x_30, x_34);
lean_dec_ref(x_30);
if (x_98 == 0)
{
if (x_35 == 0)
{
lean_object* x_99; lean_object* x_100; lean_object* x_101; 
lean_dec_ref(x_11);
x_99 = l_Lean_Expr_appFn_x21(x_1);
lean_inc_ref(x_34);
x_100 = l_Lean_Expr_app___override(x_99, x_34);
x_101 = l_Lean_Meta_Grind_shareCommon___redArg(x_100, x_5);
if (lean_obj_tag(x_101) == 0)
{
lean_object* x_102; 
x_102 = lean_ctor_get(x_101, 0);
lean_inc(x_102);
lean_dec_ref(x_101);
x_78 = x_102;
x_79 = x_2;
x_80 = x_3;
x_81 = x_4;
x_82 = x_5;
x_83 = x_6;
x_84 = x_7;
x_85 = x_8;
x_86 = x_9;
x_87 = lean_box(0);
goto block_95;
}
else
{
uint8_t x_103; 
lean_dec_ref(x_34);
lean_dec(x_33);
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_103 = !lean_is_exclusive(x_101);
if (x_103 == 0)
{
return x_101;
}
else
{
lean_object* x_104; lean_object* x_105; 
x_104 = lean_ctor_get(x_101, 0);
lean_inc(x_104);
lean_dec(x_101);
x_105 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_105, 0, x_104);
return x_105;
}
}
}
else
{
lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; 
x_106 = l_Lean_Meta_Grind_propagateProjEq___closed__4;
x_107 = l_Lean_Expr_getAppNumArgs(x_34);
lean_inc(x_107);
x_108 = lean_mk_array(x_107, x_106);
x_109 = lean_nat_sub(x_107, x_20);
lean_dec(x_107);
lean_inc_ref(x_34);
x_110 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_34, x_108, x_109);
x_111 = lean_unsigned_to_nat(0u);
lean_inc(x_18);
x_112 = l_Array_toSubarray___redArg(x_110, x_111, x_18);
x_113 = l_Array_ofSubarray___redArg(x_112);
x_114 = l_Lean_mkAppN(x_11, x_113);
lean_dec_ref(x_113);
lean_inc_ref(x_34);
x_115 = l_Lean_Expr_app___override(x_114, x_34);
x_116 = l_Lean_Meta_Grind_shareCommon___redArg(x_115, x_5);
if (lean_obj_tag(x_116) == 0)
{
lean_object* x_117; 
x_117 = lean_ctor_get(x_116, 0);
lean_inc(x_117);
lean_dec_ref(x_116);
x_78 = x_117;
x_79 = x_2;
x_80 = x_3;
x_81 = x_4;
x_82 = x_5;
x_83 = x_6;
x_84 = x_7;
x_85 = x_8;
x_86 = x_9;
x_87 = lean_box(0);
goto block_95;
}
else
{
uint8_t x_118; 
lean_dec_ref(x_34);
lean_dec(x_33);
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_118 = !lean_is_exclusive(x_116);
if (x_118 == 0)
{
return x_116;
}
else
{
lean_object* x_119; lean_object* x_120; 
x_119 = lean_ctor_get(x_116, 0);
lean_inc(x_119);
lean_dec(x_116);
x_120 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_120, 0, x_119);
return x_120;
}
}
}
}
else
{
lean_dec_ref(x_11);
x_60 = x_1;
x_61 = x_2;
x_62 = x_3;
x_63 = x_4;
x_64 = x_5;
x_65 = x_6;
x_66 = x_7;
x_67 = x_8;
x_68 = x_9;
x_69 = lean_box(0);
goto block_77;
}
}
block_59:
{
lean_object* x_44; lean_object* x_45; uint8_t x_46; 
x_44 = lean_nat_add(x_18, x_19);
lean_dec(x_19);
lean_dec(x_18);
x_45 = l_Lean_Expr_getAppNumArgs(x_34);
x_46 = lean_nat_dec_lt(x_44, x_45);
if (x_46 == 0)
{
lean_object* x_47; lean_object* x_48; 
lean_dec(x_45);
lean_dec(x_44);
lean_dec(x_42);
lean_dec_ref(x_41);
lean_dec(x_40);
lean_dec_ref(x_39);
lean_dec_ref(x_38);
lean_dec(x_37);
lean_dec_ref(x_36);
lean_dec_ref(x_34);
x_47 = lean_box(0);
if (lean_is_scalar(x_33)) {
 x_48 = lean_alloc_ctor(0, 1, 0);
} else {
 x_48 = x_33;
}
lean_ctor_set(x_48, 0, x_47);
return x_48;
}
else
{
lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; 
lean_dec(x_33);
x_49 = lean_nat_sub(x_45, x_44);
lean_dec(x_44);
lean_dec(x_45);
x_50 = lean_nat_sub(x_49, x_20);
lean_dec(x_49);
x_51 = l_Lean_Expr_getRevArg_x21(x_34, x_50);
lean_dec_ref(x_34);
lean_inc(x_42);
lean_inc_ref(x_41);
lean_inc(x_40);
lean_inc_ref(x_39);
lean_inc_ref(x_51);
x_52 = l_Lean_Meta_mkEqRefl(x_51, x_39, x_40, x_41, x_42);
if (lean_obj_tag(x_52) == 0)
{
lean_object* x_53; uint8_t x_54; lean_object* x_55; 
x_53 = lean_ctor_get(x_52, 0);
lean_inc(x_53);
lean_dec_ref(x_52);
x_54 = 0;
x_55 = l_Lean_Meta_Grind_pushEqCore___redArg(x_36, x_51, x_53, x_54, x_37, x_38, x_39, x_40, x_41, x_42);
lean_dec_ref(x_38);
lean_dec(x_37);
return x_55;
}
else
{
uint8_t x_56; 
lean_dec_ref(x_51);
lean_dec(x_42);
lean_dec_ref(x_41);
lean_dec(x_40);
lean_dec_ref(x_39);
lean_dec_ref(x_38);
lean_dec(x_37);
lean_dec_ref(x_36);
x_56 = !lean_is_exclusive(x_52);
if (x_56 == 0)
{
return x_52;
}
else
{
lean_object* x_57; lean_object* x_58; 
x_57 = lean_ctor_get(x_52, 0);
lean_inc(x_57);
lean_dec(x_52);
x_58 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_58, 0, x_57);
return x_58;
}
}
}
}
block_77:
{
lean_object* x_70; lean_object* x_71; lean_object* x_72; uint8_t x_73; 
x_70 = l_Lean_Meta_Grind_propagateProjEq___closed__3;
x_71 = l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(x_70, x_67);
x_72 = lean_ctor_get(x_71, 0);
lean_inc(x_72);
lean_dec_ref(x_71);
x_73 = lean_unbox(x_72);
lean_dec(x_72);
if (x_73 == 0)
{
lean_dec(x_64);
lean_dec(x_62);
x_36 = x_60;
x_37 = x_61;
x_38 = x_63;
x_39 = x_65;
x_40 = x_66;
x_41 = x_67;
x_42 = x_68;
x_43 = lean_box(0);
goto block_59;
}
else
{
lean_object* x_74; 
x_74 = l_Lean_Meta_Grind_updateLastTag(x_61, x_62, x_63, x_64, x_65, x_66, x_67, x_68);
lean_dec(x_64);
lean_dec(x_62);
if (lean_obj_tag(x_74) == 0)
{
lean_object* x_75; lean_object* x_76; 
lean_dec_ref(x_74);
lean_inc_ref(x_60);
x_75 = l_Lean_MessageData_ofExpr(x_60);
x_76 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(x_70, x_75, x_65, x_66, x_67, x_68);
lean_dec_ref(x_76);
x_36 = x_60;
x_37 = x_61;
x_38 = x_63;
x_39 = x_65;
x_40 = x_66;
x_41 = x_67;
x_42 = x_68;
x_43 = lean_box(0);
goto block_59;
}
else
{
lean_dec(x_68);
lean_dec_ref(x_67);
lean_dec(x_66);
lean_dec_ref(x_65);
lean_dec_ref(x_63);
lean_dec(x_61);
lean_dec_ref(x_60);
lean_dec_ref(x_34);
lean_dec(x_33);
lean_dec(x_19);
lean_dec(x_18);
return x_74;
}
}
}
block_95:
{
lean_object* x_88; 
x_88 = l_Lean_Meta_Grind_getGeneration___redArg(x_1, x_79);
lean_dec_ref(x_1);
if (lean_obj_tag(x_88) == 0)
{
lean_object* x_89; lean_object* x_90; lean_object* x_91; 
x_89 = lean_ctor_get(x_88, 0);
lean_inc(x_89);
lean_dec_ref(x_88);
x_90 = lean_box(0);
lean_inc(x_86);
lean_inc_ref(x_85);
lean_inc(x_84);
lean_inc_ref(x_83);
lean_inc(x_82);
lean_inc_ref(x_81);
lean_inc(x_80);
lean_inc(x_79);
lean_inc_ref(x_78);
x_91 = lean_grind_internalize(x_78, x_89, x_90, x_79, x_80, x_81, x_82, x_83, x_84, x_85, x_86);
if (lean_obj_tag(x_91) == 0)
{
lean_dec_ref(x_91);
x_60 = x_78;
x_61 = x_79;
x_62 = x_80;
x_63 = x_81;
x_64 = x_82;
x_65 = x_83;
x_66 = x_84;
x_67 = x_85;
x_68 = x_86;
x_69 = lean_box(0);
goto block_77;
}
else
{
lean_dec(x_86);
lean_dec_ref(x_85);
lean_dec(x_84);
lean_dec_ref(x_83);
lean_dec(x_82);
lean_dec_ref(x_81);
lean_dec(x_80);
lean_dec(x_79);
lean_dec_ref(x_78);
lean_dec_ref(x_34);
lean_dec(x_33);
lean_dec(x_19);
lean_dec(x_18);
return x_91;
}
}
else
{
uint8_t x_92; 
lean_dec(x_86);
lean_dec_ref(x_85);
lean_dec(x_84);
lean_dec_ref(x_83);
lean_dec(x_82);
lean_dec_ref(x_81);
lean_dec(x_80);
lean_dec(x_79);
lean_dec_ref(x_78);
lean_dec_ref(x_34);
lean_dec(x_33);
lean_dec(x_19);
lean_dec(x_18);
x_92 = !lean_is_exclusive(x_88);
if (x_92 == 0)
{
return x_88;
}
else
{
lean_object* x_93; lean_object* x_94; 
x_93 = lean_ctor_get(x_88, 0);
lean_inc(x_93);
lean_dec(x_88);
x_94 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_94, 0, x_93);
return x_94;
}
}
}
}
else
{
uint8_t x_121; 
lean_dec_ref(x_30);
lean_free_object(x_25);
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_17);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_121 = !lean_is_exclusive(x_31);
if (x_121 == 0)
{
return x_31;
}
else
{
lean_object* x_122; lean_object* x_123; 
x_122 = lean_ctor_get(x_31, 0);
lean_inc(x_122);
lean_dec(x_31);
x_123 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_123, 0, x_122);
return x_123;
}
}
}
}
else
{
lean_object* x_124; uint8_t x_125; 
x_124 = lean_ctor_get(x_25, 0);
lean_inc(x_124);
lean_dec(x_25);
x_125 = lean_unbox(x_124);
lean_dec(x_124);
if (x_125 == 0)
{
lean_object* x_126; lean_object* x_127; 
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_17);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_126 = lean_box(0);
x_127 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_127, 0, x_126);
return x_127;
}
else
{
lean_object* x_128; lean_object* x_129; 
x_128 = l_Lean_Expr_appArg_x21(x_1);
lean_inc_ref(x_128);
x_129 = l_Lean_Meta_Grind_getRootENode___redArg(x_128, x_2, x_6, x_7, x_8, x_9);
if (lean_obj_tag(x_129) == 0)
{
lean_object* x_130; lean_object* x_131; lean_object* x_132; uint8_t x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; lean_object* x_181; lean_object* x_182; lean_object* x_183; lean_object* x_184; lean_object* x_185; uint8_t x_194; 
x_130 = lean_ctor_get(x_129, 0);
lean_inc(x_130);
if (lean_is_exclusive(x_129)) {
 lean_ctor_release(x_129, 0);
 x_131 = x_129;
} else {
 lean_dec_ref(x_129);
 x_131 = lean_box(0);
}
x_132 = lean_ctor_get(x_130, 0);
lean_inc_ref(x_132);
x_133 = lean_ctor_get_uint8(x_130, sizeof(void*)*11 + 4);
lean_dec(x_130);
x_194 = l_Lean_Expr_isAppOf(x_132, x_17);
lean_dec(x_17);
if (x_194 == 0)
{
lean_object* x_195; lean_object* x_196; 
lean_dec_ref(x_132);
lean_dec(x_131);
lean_dec_ref(x_128);
lean_dec(x_19);
lean_dec(x_18);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_195 = lean_box(0);
x_196 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_196, 0, x_195);
return x_196;
}
else
{
uint8_t x_197; 
x_197 = l___private_Lean_Meta_Tactic_Grind_ExprPtr_0__Lean_Meta_Grind_isSameExpr_unsafe__1(x_128, x_132);
lean_dec_ref(x_128);
if (x_197 == 0)
{
if (x_133 == 0)
{
lean_object* x_198; lean_object* x_199; lean_object* x_200; 
lean_dec_ref(x_11);
x_198 = l_Lean_Expr_appFn_x21(x_1);
lean_inc_ref(x_132);
x_199 = l_Lean_Expr_app___override(x_198, x_132);
x_200 = l_Lean_Meta_Grind_shareCommon___redArg(x_199, x_5);
if (lean_obj_tag(x_200) == 0)
{
lean_object* x_201; 
x_201 = lean_ctor_get(x_200, 0);
lean_inc(x_201);
lean_dec_ref(x_200);
x_176 = x_201;
x_177 = x_2;
x_178 = x_3;
x_179 = x_4;
x_180 = x_5;
x_181 = x_6;
x_182 = x_7;
x_183 = x_8;
x_184 = x_9;
x_185 = lean_box(0);
goto block_193;
}
else
{
lean_object* x_202; lean_object* x_203; lean_object* x_204; 
lean_dec_ref(x_132);
lean_dec(x_131);
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_202 = lean_ctor_get(x_200, 0);
lean_inc(x_202);
if (lean_is_exclusive(x_200)) {
 lean_ctor_release(x_200, 0);
 x_203 = x_200;
} else {
 lean_dec_ref(x_200);
 x_203 = lean_box(0);
}
if (lean_is_scalar(x_203)) {
 x_204 = lean_alloc_ctor(1, 1, 0);
} else {
 x_204 = x_203;
}
lean_ctor_set(x_204, 0, x_202);
return x_204;
}
}
else
{
lean_object* x_205; lean_object* x_206; lean_object* x_207; lean_object* x_208; lean_object* x_209; lean_object* x_210; lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; 
x_205 = l_Lean_Meta_Grind_propagateProjEq___closed__4;
x_206 = l_Lean_Expr_getAppNumArgs(x_132);
lean_inc(x_206);
x_207 = lean_mk_array(x_206, x_205);
x_208 = lean_nat_sub(x_206, x_20);
lean_dec(x_206);
lean_inc_ref(x_132);
x_209 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_132, x_207, x_208);
x_210 = lean_unsigned_to_nat(0u);
lean_inc(x_18);
x_211 = l_Array_toSubarray___redArg(x_209, x_210, x_18);
x_212 = l_Array_ofSubarray___redArg(x_211);
x_213 = l_Lean_mkAppN(x_11, x_212);
lean_dec_ref(x_212);
lean_inc_ref(x_132);
x_214 = l_Lean_Expr_app___override(x_213, x_132);
x_215 = l_Lean_Meta_Grind_shareCommon___redArg(x_214, x_5);
if (lean_obj_tag(x_215) == 0)
{
lean_object* x_216; 
x_216 = lean_ctor_get(x_215, 0);
lean_inc(x_216);
lean_dec_ref(x_215);
x_176 = x_216;
x_177 = x_2;
x_178 = x_3;
x_179 = x_4;
x_180 = x_5;
x_181 = x_6;
x_182 = x_7;
x_183 = x_8;
x_184 = x_9;
x_185 = lean_box(0);
goto block_193;
}
else
{
lean_object* x_217; lean_object* x_218; lean_object* x_219; 
lean_dec_ref(x_132);
lean_dec(x_131);
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_217 = lean_ctor_get(x_215, 0);
lean_inc(x_217);
if (lean_is_exclusive(x_215)) {
 lean_ctor_release(x_215, 0);
 x_218 = x_215;
} else {
 lean_dec_ref(x_215);
 x_218 = lean_box(0);
}
if (lean_is_scalar(x_218)) {
 x_219 = lean_alloc_ctor(1, 1, 0);
} else {
 x_219 = x_218;
}
lean_ctor_set(x_219, 0, x_217);
return x_219;
}
}
}
else
{
lean_dec_ref(x_11);
x_158 = x_1;
x_159 = x_2;
x_160 = x_3;
x_161 = x_4;
x_162 = x_5;
x_163 = x_6;
x_164 = x_7;
x_165 = x_8;
x_166 = x_9;
x_167 = lean_box(0);
goto block_175;
}
}
block_157:
{
lean_object* x_142; lean_object* x_143; uint8_t x_144; 
x_142 = lean_nat_add(x_18, x_19);
lean_dec(x_19);
lean_dec(x_18);
x_143 = l_Lean_Expr_getAppNumArgs(x_132);
x_144 = lean_nat_dec_lt(x_142, x_143);
if (x_144 == 0)
{
lean_object* x_145; lean_object* x_146; 
lean_dec(x_143);
lean_dec(x_142);
lean_dec(x_140);
lean_dec_ref(x_139);
lean_dec(x_138);
lean_dec_ref(x_137);
lean_dec_ref(x_136);
lean_dec(x_135);
lean_dec_ref(x_134);
lean_dec_ref(x_132);
x_145 = lean_box(0);
if (lean_is_scalar(x_131)) {
 x_146 = lean_alloc_ctor(0, 1, 0);
} else {
 x_146 = x_131;
}
lean_ctor_set(x_146, 0, x_145);
return x_146;
}
else
{
lean_object* x_147; lean_object* x_148; lean_object* x_149; lean_object* x_150; 
lean_dec(x_131);
x_147 = lean_nat_sub(x_143, x_142);
lean_dec(x_142);
lean_dec(x_143);
x_148 = lean_nat_sub(x_147, x_20);
lean_dec(x_147);
x_149 = l_Lean_Expr_getRevArg_x21(x_132, x_148);
lean_dec_ref(x_132);
lean_inc(x_140);
lean_inc_ref(x_139);
lean_inc(x_138);
lean_inc_ref(x_137);
lean_inc_ref(x_149);
x_150 = l_Lean_Meta_mkEqRefl(x_149, x_137, x_138, x_139, x_140);
if (lean_obj_tag(x_150) == 0)
{
lean_object* x_151; uint8_t x_152; lean_object* x_153; 
x_151 = lean_ctor_get(x_150, 0);
lean_inc(x_151);
lean_dec_ref(x_150);
x_152 = 0;
x_153 = l_Lean_Meta_Grind_pushEqCore___redArg(x_134, x_149, x_151, x_152, x_135, x_136, x_137, x_138, x_139, x_140);
lean_dec_ref(x_136);
lean_dec(x_135);
return x_153;
}
else
{
lean_object* x_154; lean_object* x_155; lean_object* x_156; 
lean_dec_ref(x_149);
lean_dec(x_140);
lean_dec_ref(x_139);
lean_dec(x_138);
lean_dec_ref(x_137);
lean_dec_ref(x_136);
lean_dec(x_135);
lean_dec_ref(x_134);
x_154 = lean_ctor_get(x_150, 0);
lean_inc(x_154);
if (lean_is_exclusive(x_150)) {
 lean_ctor_release(x_150, 0);
 x_155 = x_150;
} else {
 lean_dec_ref(x_150);
 x_155 = lean_box(0);
}
if (lean_is_scalar(x_155)) {
 x_156 = lean_alloc_ctor(1, 1, 0);
} else {
 x_156 = x_155;
}
lean_ctor_set(x_156, 0, x_154);
return x_156;
}
}
}
block_175:
{
lean_object* x_168; lean_object* x_169; lean_object* x_170; uint8_t x_171; 
x_168 = l_Lean_Meta_Grind_propagateProjEq___closed__3;
x_169 = l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(x_168, x_165);
x_170 = lean_ctor_get(x_169, 0);
lean_inc(x_170);
lean_dec_ref(x_169);
x_171 = lean_unbox(x_170);
lean_dec(x_170);
if (x_171 == 0)
{
lean_dec(x_162);
lean_dec(x_160);
x_134 = x_158;
x_135 = x_159;
x_136 = x_161;
x_137 = x_163;
x_138 = x_164;
x_139 = x_165;
x_140 = x_166;
x_141 = lean_box(0);
goto block_157;
}
else
{
lean_object* x_172; 
x_172 = l_Lean_Meta_Grind_updateLastTag(x_159, x_160, x_161, x_162, x_163, x_164, x_165, x_166);
lean_dec(x_162);
lean_dec(x_160);
if (lean_obj_tag(x_172) == 0)
{
lean_object* x_173; lean_object* x_174; 
lean_dec_ref(x_172);
lean_inc_ref(x_158);
x_173 = l_Lean_MessageData_ofExpr(x_158);
x_174 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(x_168, x_173, x_163, x_164, x_165, x_166);
lean_dec_ref(x_174);
x_134 = x_158;
x_135 = x_159;
x_136 = x_161;
x_137 = x_163;
x_138 = x_164;
x_139 = x_165;
x_140 = x_166;
x_141 = lean_box(0);
goto block_157;
}
else
{
lean_dec(x_166);
lean_dec_ref(x_165);
lean_dec(x_164);
lean_dec_ref(x_163);
lean_dec_ref(x_161);
lean_dec(x_159);
lean_dec_ref(x_158);
lean_dec_ref(x_132);
lean_dec(x_131);
lean_dec(x_19);
lean_dec(x_18);
return x_172;
}
}
}
block_193:
{
lean_object* x_186; 
x_186 = l_Lean_Meta_Grind_getGeneration___redArg(x_1, x_177);
lean_dec_ref(x_1);
if (lean_obj_tag(x_186) == 0)
{
lean_object* x_187; lean_object* x_188; lean_object* x_189; 
x_187 = lean_ctor_get(x_186, 0);
lean_inc(x_187);
lean_dec_ref(x_186);
x_188 = lean_box(0);
lean_inc(x_184);
lean_inc_ref(x_183);
lean_inc(x_182);
lean_inc_ref(x_181);
lean_inc(x_180);
lean_inc_ref(x_179);
lean_inc(x_178);
lean_inc(x_177);
lean_inc_ref(x_176);
x_189 = lean_grind_internalize(x_176, x_187, x_188, x_177, x_178, x_179, x_180, x_181, x_182, x_183, x_184);
if (lean_obj_tag(x_189) == 0)
{
lean_dec_ref(x_189);
x_158 = x_176;
x_159 = x_177;
x_160 = x_178;
x_161 = x_179;
x_162 = x_180;
x_163 = x_181;
x_164 = x_182;
x_165 = x_183;
x_166 = x_184;
x_167 = lean_box(0);
goto block_175;
}
else
{
lean_dec(x_184);
lean_dec_ref(x_183);
lean_dec(x_182);
lean_dec_ref(x_181);
lean_dec(x_180);
lean_dec_ref(x_179);
lean_dec(x_178);
lean_dec(x_177);
lean_dec_ref(x_176);
lean_dec_ref(x_132);
lean_dec(x_131);
lean_dec(x_19);
lean_dec(x_18);
return x_189;
}
}
else
{
lean_object* x_190; lean_object* x_191; lean_object* x_192; 
lean_dec(x_184);
lean_dec_ref(x_183);
lean_dec(x_182);
lean_dec_ref(x_181);
lean_dec(x_180);
lean_dec_ref(x_179);
lean_dec(x_178);
lean_dec(x_177);
lean_dec_ref(x_176);
lean_dec_ref(x_132);
lean_dec(x_131);
lean_dec(x_19);
lean_dec(x_18);
x_190 = lean_ctor_get(x_186, 0);
lean_inc(x_190);
if (lean_is_exclusive(x_186)) {
 lean_ctor_release(x_186, 0);
 x_191 = x_186;
} else {
 lean_dec_ref(x_186);
 x_191 = lean_box(0);
}
if (lean_is_scalar(x_191)) {
 x_192 = lean_alloc_ctor(1, 1, 0);
} else {
 x_192 = x_191;
}
lean_ctor_set(x_192, 0, x_190);
return x_192;
}
}
}
else
{
lean_object* x_220; lean_object* x_221; lean_object* x_222; 
lean_dec_ref(x_128);
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_17);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_220 = lean_ctor_get(x_129, 0);
lean_inc(x_220);
if (lean_is_exclusive(x_129)) {
 lean_ctor_release(x_129, 0);
 x_221 = x_129;
} else {
 lean_dec_ref(x_129);
 x_221 = lean_box(0);
}
if (lean_is_scalar(x_221)) {
 x_222 = lean_alloc_ctor(1, 1, 0);
} else {
 x_222 = x_221;
}
lean_ctor_set(x_222, 0, x_220);
return x_222;
}
}
}
}
else
{
uint8_t x_223; 
lean_dec(x_19);
lean_dec(x_18);
lean_dec(x_17);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_223 = !lean_is_exclusive(x_25);
if (x_223 == 0)
{
return x_25;
}
else
{
lean_object* x_224; lean_object* x_225; 
x_224 = lean_ctor_get(x_25, 0);
lean_inc(x_224);
lean_dec(x_25);
x_225 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_225, 0, x_224);
return x_225;
}
}
}
}
else
{
lean_object* x_226; 
lean_dec(x_15);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_226 = lean_box(0);
lean_ctor_set(x_13, 0, x_226);
return x_13;
}
}
else
{
lean_object* x_227; 
x_227 = lean_ctor_get(x_13, 0);
lean_inc(x_227);
lean_dec(x_13);
if (lean_obj_tag(x_227) == 1)
{
lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; lean_object* x_232; lean_object* x_233; lean_object* x_234; uint8_t x_235; 
x_228 = lean_ctor_get(x_227, 0);
lean_inc(x_228);
lean_dec_ref(x_227);
x_229 = lean_ctor_get(x_228, 0);
lean_inc(x_229);
x_230 = lean_ctor_get(x_228, 1);
lean_inc(x_230);
x_231 = lean_ctor_get(x_228, 2);
lean_inc(x_231);
lean_dec(x_228);
x_232 = lean_unsigned_to_nat(1u);
x_233 = lean_nat_add(x_230, x_232);
x_234 = l_Lean_Expr_getAppNumArgs(x_1);
x_235 = lean_nat_dec_eq(x_233, x_234);
lean_dec(x_234);
lean_dec(x_233);
if (x_235 == 0)
{
lean_object* x_236; lean_object* x_237; 
lean_dec(x_231);
lean_dec(x_230);
lean_dec(x_229);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_236 = lean_box(0);
x_237 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_237, 0, x_236);
return x_237;
}
else
{
lean_object* x_238; 
lean_inc_ref(x_1);
x_238 = l_Lean_Meta_Grind_isCongrRoot___redArg(x_1, x_2, x_6, x_7, x_8, x_9);
if (lean_obj_tag(x_238) == 0)
{
lean_object* x_239; lean_object* x_240; uint8_t x_241; 
x_239 = lean_ctor_get(x_238, 0);
lean_inc(x_239);
if (lean_is_exclusive(x_238)) {
 lean_ctor_release(x_238, 0);
 x_240 = x_238;
} else {
 lean_dec_ref(x_238);
 x_240 = lean_box(0);
}
x_241 = lean_unbox(x_239);
lean_dec(x_239);
if (x_241 == 0)
{
lean_object* x_242; lean_object* x_243; 
lean_dec(x_231);
lean_dec(x_230);
lean_dec(x_229);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_242 = lean_box(0);
if (lean_is_scalar(x_240)) {
 x_243 = lean_alloc_ctor(0, 1, 0);
} else {
 x_243 = x_240;
}
lean_ctor_set(x_243, 0, x_242);
return x_243;
}
else
{
lean_object* x_244; lean_object* x_245; 
x_244 = l_Lean_Expr_appArg_x21(x_1);
lean_inc_ref(x_244);
x_245 = l_Lean_Meta_Grind_getRootENode___redArg(x_244, x_2, x_6, x_7, x_8, x_9);
if (lean_obj_tag(x_245) == 0)
{
lean_object* x_246; lean_object* x_247; lean_object* x_248; uint8_t x_249; lean_object* x_250; lean_object* x_251; lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; lean_object* x_257; lean_object* x_274; lean_object* x_275; lean_object* x_276; lean_object* x_277; lean_object* x_278; lean_object* x_279; lean_object* x_280; lean_object* x_281; lean_object* x_282; lean_object* x_283; lean_object* x_292; lean_object* x_293; lean_object* x_294; lean_object* x_295; lean_object* x_296; lean_object* x_297; lean_object* x_298; lean_object* x_299; lean_object* x_300; lean_object* x_301; uint8_t x_310; 
x_246 = lean_ctor_get(x_245, 0);
lean_inc(x_246);
if (lean_is_exclusive(x_245)) {
 lean_ctor_release(x_245, 0);
 x_247 = x_245;
} else {
 lean_dec_ref(x_245);
 x_247 = lean_box(0);
}
x_248 = lean_ctor_get(x_246, 0);
lean_inc_ref(x_248);
x_249 = lean_ctor_get_uint8(x_246, sizeof(void*)*11 + 4);
lean_dec(x_246);
x_310 = l_Lean_Expr_isAppOf(x_248, x_229);
lean_dec(x_229);
if (x_310 == 0)
{
lean_object* x_311; lean_object* x_312; 
lean_dec_ref(x_248);
lean_dec(x_247);
lean_dec_ref(x_244);
lean_dec(x_231);
lean_dec(x_230);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_311 = lean_box(0);
if (lean_is_scalar(x_240)) {
 x_312 = lean_alloc_ctor(0, 1, 0);
} else {
 x_312 = x_240;
}
lean_ctor_set(x_312, 0, x_311);
return x_312;
}
else
{
uint8_t x_313; 
lean_dec(x_240);
x_313 = l___private_Lean_Meta_Tactic_Grind_ExprPtr_0__Lean_Meta_Grind_isSameExpr_unsafe__1(x_244, x_248);
lean_dec_ref(x_244);
if (x_313 == 0)
{
if (x_249 == 0)
{
lean_object* x_314; lean_object* x_315; lean_object* x_316; 
lean_dec_ref(x_11);
x_314 = l_Lean_Expr_appFn_x21(x_1);
lean_inc_ref(x_248);
x_315 = l_Lean_Expr_app___override(x_314, x_248);
x_316 = l_Lean_Meta_Grind_shareCommon___redArg(x_315, x_5);
if (lean_obj_tag(x_316) == 0)
{
lean_object* x_317; 
x_317 = lean_ctor_get(x_316, 0);
lean_inc(x_317);
lean_dec_ref(x_316);
x_292 = x_317;
x_293 = x_2;
x_294 = x_3;
x_295 = x_4;
x_296 = x_5;
x_297 = x_6;
x_298 = x_7;
x_299 = x_8;
x_300 = x_9;
x_301 = lean_box(0);
goto block_309;
}
else
{
lean_object* x_318; lean_object* x_319; lean_object* x_320; 
lean_dec_ref(x_248);
lean_dec(x_247);
lean_dec(x_231);
lean_dec(x_230);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_318 = lean_ctor_get(x_316, 0);
lean_inc(x_318);
if (lean_is_exclusive(x_316)) {
 lean_ctor_release(x_316, 0);
 x_319 = x_316;
} else {
 lean_dec_ref(x_316);
 x_319 = lean_box(0);
}
if (lean_is_scalar(x_319)) {
 x_320 = lean_alloc_ctor(1, 1, 0);
} else {
 x_320 = x_319;
}
lean_ctor_set(x_320, 0, x_318);
return x_320;
}
}
else
{
lean_object* x_321; lean_object* x_322; lean_object* x_323; lean_object* x_324; lean_object* x_325; lean_object* x_326; lean_object* x_327; lean_object* x_328; lean_object* x_329; lean_object* x_330; lean_object* x_331; 
x_321 = l_Lean_Meta_Grind_propagateProjEq___closed__4;
x_322 = l_Lean_Expr_getAppNumArgs(x_248);
lean_inc(x_322);
x_323 = lean_mk_array(x_322, x_321);
x_324 = lean_nat_sub(x_322, x_232);
lean_dec(x_322);
lean_inc_ref(x_248);
x_325 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_248, x_323, x_324);
x_326 = lean_unsigned_to_nat(0u);
lean_inc(x_230);
x_327 = l_Array_toSubarray___redArg(x_325, x_326, x_230);
x_328 = l_Array_ofSubarray___redArg(x_327);
x_329 = l_Lean_mkAppN(x_11, x_328);
lean_dec_ref(x_328);
lean_inc_ref(x_248);
x_330 = l_Lean_Expr_app___override(x_329, x_248);
x_331 = l_Lean_Meta_Grind_shareCommon___redArg(x_330, x_5);
if (lean_obj_tag(x_331) == 0)
{
lean_object* x_332; 
x_332 = lean_ctor_get(x_331, 0);
lean_inc(x_332);
lean_dec_ref(x_331);
x_292 = x_332;
x_293 = x_2;
x_294 = x_3;
x_295 = x_4;
x_296 = x_5;
x_297 = x_6;
x_298 = x_7;
x_299 = x_8;
x_300 = x_9;
x_301 = lean_box(0);
goto block_309;
}
else
{
lean_object* x_333; lean_object* x_334; lean_object* x_335; 
lean_dec_ref(x_248);
lean_dec(x_247);
lean_dec(x_231);
lean_dec(x_230);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_333 = lean_ctor_get(x_331, 0);
lean_inc(x_333);
if (lean_is_exclusive(x_331)) {
 lean_ctor_release(x_331, 0);
 x_334 = x_331;
} else {
 lean_dec_ref(x_331);
 x_334 = lean_box(0);
}
if (lean_is_scalar(x_334)) {
 x_335 = lean_alloc_ctor(1, 1, 0);
} else {
 x_335 = x_334;
}
lean_ctor_set(x_335, 0, x_333);
return x_335;
}
}
}
else
{
lean_dec_ref(x_11);
x_274 = x_1;
x_275 = x_2;
x_276 = x_3;
x_277 = x_4;
x_278 = x_5;
x_279 = x_6;
x_280 = x_7;
x_281 = x_8;
x_282 = x_9;
x_283 = lean_box(0);
goto block_291;
}
}
block_273:
{
lean_object* x_258; lean_object* x_259; uint8_t x_260; 
x_258 = lean_nat_add(x_230, x_231);
lean_dec(x_231);
lean_dec(x_230);
x_259 = l_Lean_Expr_getAppNumArgs(x_248);
x_260 = lean_nat_dec_lt(x_258, x_259);
if (x_260 == 0)
{
lean_object* x_261; lean_object* x_262; 
lean_dec(x_259);
lean_dec(x_258);
lean_dec(x_256);
lean_dec_ref(x_255);
lean_dec(x_254);
lean_dec_ref(x_253);
lean_dec_ref(x_252);
lean_dec(x_251);
lean_dec_ref(x_250);
lean_dec_ref(x_248);
x_261 = lean_box(0);
if (lean_is_scalar(x_247)) {
 x_262 = lean_alloc_ctor(0, 1, 0);
} else {
 x_262 = x_247;
}
lean_ctor_set(x_262, 0, x_261);
return x_262;
}
else
{
lean_object* x_263; lean_object* x_264; lean_object* x_265; lean_object* x_266; 
lean_dec(x_247);
x_263 = lean_nat_sub(x_259, x_258);
lean_dec(x_258);
lean_dec(x_259);
x_264 = lean_nat_sub(x_263, x_232);
lean_dec(x_263);
x_265 = l_Lean_Expr_getRevArg_x21(x_248, x_264);
lean_dec_ref(x_248);
lean_inc(x_256);
lean_inc_ref(x_255);
lean_inc(x_254);
lean_inc_ref(x_253);
lean_inc_ref(x_265);
x_266 = l_Lean_Meta_mkEqRefl(x_265, x_253, x_254, x_255, x_256);
if (lean_obj_tag(x_266) == 0)
{
lean_object* x_267; uint8_t x_268; lean_object* x_269; 
x_267 = lean_ctor_get(x_266, 0);
lean_inc(x_267);
lean_dec_ref(x_266);
x_268 = 0;
x_269 = l_Lean_Meta_Grind_pushEqCore___redArg(x_250, x_265, x_267, x_268, x_251, x_252, x_253, x_254, x_255, x_256);
lean_dec_ref(x_252);
lean_dec(x_251);
return x_269;
}
else
{
lean_object* x_270; lean_object* x_271; lean_object* x_272; 
lean_dec_ref(x_265);
lean_dec(x_256);
lean_dec_ref(x_255);
lean_dec(x_254);
lean_dec_ref(x_253);
lean_dec_ref(x_252);
lean_dec(x_251);
lean_dec_ref(x_250);
x_270 = lean_ctor_get(x_266, 0);
lean_inc(x_270);
if (lean_is_exclusive(x_266)) {
 lean_ctor_release(x_266, 0);
 x_271 = x_266;
} else {
 lean_dec_ref(x_266);
 x_271 = lean_box(0);
}
if (lean_is_scalar(x_271)) {
 x_272 = lean_alloc_ctor(1, 1, 0);
} else {
 x_272 = x_271;
}
lean_ctor_set(x_272, 0, x_270);
return x_272;
}
}
}
block_291:
{
lean_object* x_284; lean_object* x_285; lean_object* x_286; uint8_t x_287; 
x_284 = l_Lean_Meta_Grind_propagateProjEq___closed__3;
x_285 = l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(x_284, x_281);
x_286 = lean_ctor_get(x_285, 0);
lean_inc(x_286);
lean_dec_ref(x_285);
x_287 = lean_unbox(x_286);
lean_dec(x_286);
if (x_287 == 0)
{
lean_dec(x_278);
lean_dec(x_276);
x_250 = x_274;
x_251 = x_275;
x_252 = x_277;
x_253 = x_279;
x_254 = x_280;
x_255 = x_281;
x_256 = x_282;
x_257 = lean_box(0);
goto block_273;
}
else
{
lean_object* x_288; 
x_288 = l_Lean_Meta_Grind_updateLastTag(x_275, x_276, x_277, x_278, x_279, x_280, x_281, x_282);
lean_dec(x_278);
lean_dec(x_276);
if (lean_obj_tag(x_288) == 0)
{
lean_object* x_289; lean_object* x_290; 
lean_dec_ref(x_288);
lean_inc_ref(x_274);
x_289 = l_Lean_MessageData_ofExpr(x_274);
x_290 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(x_284, x_289, x_279, x_280, x_281, x_282);
lean_dec_ref(x_290);
x_250 = x_274;
x_251 = x_275;
x_252 = x_277;
x_253 = x_279;
x_254 = x_280;
x_255 = x_281;
x_256 = x_282;
x_257 = lean_box(0);
goto block_273;
}
else
{
lean_dec(x_282);
lean_dec_ref(x_281);
lean_dec(x_280);
lean_dec_ref(x_279);
lean_dec_ref(x_277);
lean_dec(x_275);
lean_dec_ref(x_274);
lean_dec_ref(x_248);
lean_dec(x_247);
lean_dec(x_231);
lean_dec(x_230);
return x_288;
}
}
}
block_309:
{
lean_object* x_302; 
x_302 = l_Lean_Meta_Grind_getGeneration___redArg(x_1, x_293);
lean_dec_ref(x_1);
if (lean_obj_tag(x_302) == 0)
{
lean_object* x_303; lean_object* x_304; lean_object* x_305; 
x_303 = lean_ctor_get(x_302, 0);
lean_inc(x_303);
lean_dec_ref(x_302);
x_304 = lean_box(0);
lean_inc(x_300);
lean_inc_ref(x_299);
lean_inc(x_298);
lean_inc_ref(x_297);
lean_inc(x_296);
lean_inc_ref(x_295);
lean_inc(x_294);
lean_inc(x_293);
lean_inc_ref(x_292);
x_305 = lean_grind_internalize(x_292, x_303, x_304, x_293, x_294, x_295, x_296, x_297, x_298, x_299, x_300);
if (lean_obj_tag(x_305) == 0)
{
lean_dec_ref(x_305);
x_274 = x_292;
x_275 = x_293;
x_276 = x_294;
x_277 = x_295;
x_278 = x_296;
x_279 = x_297;
x_280 = x_298;
x_281 = x_299;
x_282 = x_300;
x_283 = lean_box(0);
goto block_291;
}
else
{
lean_dec(x_300);
lean_dec_ref(x_299);
lean_dec(x_298);
lean_dec_ref(x_297);
lean_dec(x_296);
lean_dec_ref(x_295);
lean_dec(x_294);
lean_dec(x_293);
lean_dec_ref(x_292);
lean_dec_ref(x_248);
lean_dec(x_247);
lean_dec(x_231);
lean_dec(x_230);
return x_305;
}
}
else
{
lean_object* x_306; lean_object* x_307; lean_object* x_308; 
lean_dec(x_300);
lean_dec_ref(x_299);
lean_dec(x_298);
lean_dec_ref(x_297);
lean_dec(x_296);
lean_dec_ref(x_295);
lean_dec(x_294);
lean_dec(x_293);
lean_dec_ref(x_292);
lean_dec_ref(x_248);
lean_dec(x_247);
lean_dec(x_231);
lean_dec(x_230);
x_306 = lean_ctor_get(x_302, 0);
lean_inc(x_306);
if (lean_is_exclusive(x_302)) {
 lean_ctor_release(x_302, 0);
 x_307 = x_302;
} else {
 lean_dec_ref(x_302);
 x_307 = lean_box(0);
}
if (lean_is_scalar(x_307)) {
 x_308 = lean_alloc_ctor(1, 1, 0);
} else {
 x_308 = x_307;
}
lean_ctor_set(x_308, 0, x_306);
return x_308;
}
}
}
else
{
lean_object* x_336; lean_object* x_337; lean_object* x_338; 
lean_dec_ref(x_244);
lean_dec(x_240);
lean_dec(x_231);
lean_dec(x_230);
lean_dec(x_229);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_336 = lean_ctor_get(x_245, 0);
lean_inc(x_336);
if (lean_is_exclusive(x_245)) {
 lean_ctor_release(x_245, 0);
 x_337 = x_245;
} else {
 lean_dec_ref(x_245);
 x_337 = lean_box(0);
}
if (lean_is_scalar(x_337)) {
 x_338 = lean_alloc_ctor(1, 1, 0);
} else {
 x_338 = x_337;
}
lean_ctor_set(x_338, 0, x_336);
return x_338;
}
}
}
else
{
lean_object* x_339; lean_object* x_340; lean_object* x_341; 
lean_dec(x_231);
lean_dec(x_230);
lean_dec(x_229);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_339 = lean_ctor_get(x_238, 0);
lean_inc(x_339);
if (lean_is_exclusive(x_238)) {
 lean_ctor_release(x_238, 0);
 x_340 = x_238;
} else {
 lean_dec_ref(x_238);
 x_340 = lean_box(0);
}
if (lean_is_scalar(x_340)) {
 x_341 = lean_alloc_ctor(1, 1, 0);
} else {
 x_341 = x_340;
}
lean_ctor_set(x_341, 0, x_339);
return x_341;
}
}
}
else
{
lean_object* x_342; lean_object* x_343; 
lean_dec(x_227);
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_342 = lean_box(0);
x_343 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_343, 0, x_342);
return x_343;
}
}
}
else
{
lean_object* x_344; lean_object* x_345; 
lean_dec_ref(x_11);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec_ref(x_1);
x_344 = lean_box(0);
x_345 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_345, 0, x_344);
return x_345;
}
}
}
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
_start:
{
lean_object* x_12; 
x_12 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
lean_dec(x_10);
lean_dec_ref(x_9);
lean_dec(x_8);
lean_dec_ref(x_7);
lean_dec(x_6);
lean_dec_ref(x_5);
lean_dec(x_4);
lean_dec(x_3);
return x_12;
}
}
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
_start:
{
lean_object* x_11; 
x_11 = l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
return x_11;
}
}
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
_start:
{
lean_object* x_11; 
x_11 = l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
lean_dec(x_9);
lean_dec_ref(x_8);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec(x_2);
return x_11;
}
}
LEAN_EXPORT lean_object* l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; 
x_4 = l_Lean_isTracingEnabledFor___at___00Lean_Meta_Grind_propagateProjEq_spec__1___redArg(x_1, x_2);
lean_dec_ref(x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; 
x_4 = l_Lean_getProjectionFnInfo_x3f___at___00Lean_Meta_Grind_propagateProjEq_spec__0___redArg(x_1, x_2);
lean_dec(x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2_spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lean_addMessageContextFull___at___00Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2_spec__2(x_1, x_2, x_3, x_4, x_5);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
lean_object* x_8; 
x_8 = l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_6);
lean_dec_ref(x_5);
lean_dec(x_4);
lean_dec_ref(x_3);
return x_8;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Grind_propagateProjEq___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
_start:
{
lean_object* x_11; 
x_11 = l_Lean_Meta_Grind_propagateProjEq(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
return x_11;
}
}
lean_object* initialize_Lean_Meta_Tactic_Grind_Types(uint8_t builtin);
lean_object* initialize_Lean_Meta_Tactic_Grind_Internalize(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Lean_Meta_Tactic_Grind_Proj(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Lean_Meta_Tactic_Grind_Types(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_Tactic_Grind_Internalize(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0 = _init_l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__0();
l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1 = _init_l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1();
lean_mark_persistent(l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__1);
l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2 = _init_l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2();
lean_mark_persistent(l_Lean_addTrace___at___00Lean_Meta_Grind_propagateProjEq_spec__2___redArg___closed__2);
l_Lean_Meta_Grind_propagateProjEq___closed__0 = _init_l_Lean_Meta_Grind_propagateProjEq___closed__0();
lean_mark_persistent(l_Lean_Meta_Grind_propagateProjEq___closed__0);
l_Lean_Meta_Grind_propagateProjEq___closed__1 = _init_l_Lean_Meta_Grind_propagateProjEq___closed__1();
lean_mark_persistent(l_Lean_Meta_Grind_propagateProjEq___closed__1);
l_Lean_Meta_Grind_propagateProjEq___closed__2 = _init_l_Lean_Meta_Grind_propagateProjEq___closed__2();
lean_mark_persistent(l_Lean_Meta_Grind_propagateProjEq___closed__2);
l_Lean_Meta_Grind_propagateProjEq___closed__3 = _init_l_Lean_Meta_Grind_propagateProjEq___closed__3();
lean_mark_persistent(l_Lean_Meta_Grind_propagateProjEq___closed__3);
l_Lean_Meta_Grind_propagateProjEq___closed__4 = _init_l_Lean_Meta_Grind_propagateProjEq___closed__4();
lean_mark_persistent(l_Lean_Meta_Grind_propagateProjEq___closed__4);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus
}
#endif
